| Total Complexity | 3 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import {chat_v1 as chatV1} from 'googleapis/build/src/apis/chat/v1'; |
||
| 14 | |||
| 15 | export abstract class BaseCard implements Card { |
||
| 16 | private id: string = 'cardId'; |
||
| 17 | private _content: chatV1.Schema$GoogleAppsCardV1Section[] = []; |
||
| 18 | |||
| 19 | protected card: chatV1.Schema$GoogleAppsCardV1Card = { |
||
| 20 | sections: this._content, |
||
| 21 | }; |
||
| 22 | |||
| 23 | abstract buildSections(): void; |
||
| 24 | |||
| 25 | make(): chatV1.Schema$CardWithId { |
||
| 26 | return { |
||
| 27 | 'cardId': this.id, |
||
| 28 | 'card': this.card, |
||
| 29 | }; |
||
| 30 | } |
||
| 31 | |||
| 32 | buildMessage(): chatV1.Schema$Message { |
||
| 33 | return {cardsV2: [this.make()]}; |
||
| 34 | } |
||
| 36 |